class Login {//login_request
  final int loginType;
  final String? account;
  final String? pwd;
  final String? wxUnionId;
  final String? emailAddress;
  final String? flyUnionid;
  final String? appID;
  final String? sendTime;
  final String? token;
  final String? phoneNum;
  final String? verifyCode;

  Login({
    required this.loginType,
    this.account,
    this.pwd,
    this.wxUnionId,
    this.emailAddress,
    this.flyUnionid,
    this.appID,
    this.sendTime,
    this.token,
    this.phoneNum,
    this.verifyCode,
  });

  factory Login.fromJson(Map<String, dynamic> json) {
    return Login(
      loginType: json['loginType'] as int,
      account: json['account'] as String,
      pwd: json['pwd'] as String,
      wxUnionId: json['wxUnionId'] as String,
      emailAddress: json['emailAddress'] as String,
      flyUnionid: json['flyUnionid'] as String,
      appID: json['appID'] as String,
      sendTime: json['sendTime'] as String,
      token: json['token'] as String,
      phoneNum: json['phoneNum'] as String,
      verifyCode: json['verifyCode'] as String,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'loginType': loginType,
      'account': account ?? '',
      'pwd': pwd ?? '',
      'wxUnionId': wxUnionId ?? '',
      'emailAddress': emailAddress ?? '',
      'flyUnionid': flyUnionid ?? '',
      'appID': appID ?? '',
      'sendTime': sendTime ?? '',
      'token': token ?? '',
      'phoneNum': phoneNum ?? '',
      'verifyCode': verifyCode ?? '',
    };
  }
}


class ELoginType {
  final int value;
  final String name;

  const ELoginType._internal(this.value, this.name);
  // 帐号密码登陆
  static const ELoginType Account = const ELoginType._internal(0, 'Account');
  //手机验证码
  static const ELoginType MobilePhone = const ELoginType._internal(1, 'MobilePhone');
  //邮箱登陆
  static const ELoginType Email = const ELoginType._internal(2, 'Email');
  //微信授权登陆
  static const ELoginType WxChat = const ELoginType._internal(3, 'WxChat');
  //飞书登陆
  static const ELoginType FhChat = const ELoginType._internal(4, 'FhChat');
}

